package com.jwsoft.manager.core.gateway.controller;

import com.jwsoft.manager.core.integration.EduPushparentsIntegration;
import com.jwsoft.manager.common.vo.eduPushparents.EduPushparentsVO;
import com.jwsoft.manager.common.vo.eduPushparents.EduPushparentsKeyVO;
import com.jwsoft.manager.common.vo.eduPushparents.EduPushparentsQueryVO;
import com.github.pagehelper.PageInfo;
import com.bifang.engine.assistant.core.domain.AppResponse;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RestController;
import com.bifang.engine.protect.core.annotation.Idempotent;
import org.springframework.validation.annotation.Validated;
import com.bifang.assistant.common.constants.Validators;

/**
 * 是否推送信息表网关
 *
 * @author zjl
 * @since 2024-04-08
 */
@RestController
@RequestMapping(value = "/doc/api")
@Tag(name = "是否推送信息表", description = "是否推送信息表")
public class EduPushparentsController {

    @Autowired
    public EduPushparentsIntegration eduPushparentsIntegration;

    @Operation(summary = "是否推送信息表分页查询",description = "是否推送信息表分页查询")
    @PostMapping(value = "/eduPushparents0001", produces = "application/json;charset=UTF-8")
    public AppResponse<PageInfo<EduPushparentsVO>> getList(@RequestBody @Validated EduPushparentsQueryVO vo) {
        return AppResponse.successData(eduPushparentsIntegration.getList(vo));
    }

    @Operation(summary = "是否推送信息表根据主键查询详情",description = "是否推送信息表根据主键查询详情")
    @PostMapping(value = "/eduPushparents0002", produces = "application/json;charset=UTF-8")
    public AppResponse<EduPushparentsVO> getById(@RequestBody @Validated EduPushparentsKeyVO vo) {
        return AppResponse.successData(eduPushparentsIntegration.getById(vo));
    }

    @Idempotent(expire="PT2S") //2秒内防重复提交
    @Operation(summary = "是否推送信息表新增",description = "是否推送信息表新增")
    @PostMapping(value = "/eduPushparents0004", produces = "application/json;charset=UTF-8")
    public AppResponse<EduPushparentsVO> add(@RequestBody @Validated(value = {Validators.Add.class}) EduPushparentsVO vo) {
        return AppResponse.successData(eduPushparentsIntegration.add(vo));
    }

    @Idempotent(expire="PT2S") //2秒内防重复提交
    @Operation(summary = "是否推送信息表修改",description = "是否推送信息表修改")
    @PostMapping(value = "/eduPushparents0005", produces = "application/json;charset=UTF-8")
    public AppResponse<EduPushparentsVO> edit(@RequestBody @Validated(value = {Validators.Edit.class}) EduPushparentsVO vo) {
        return AppResponse.successData(eduPushparentsIntegration.edit(vo));
    }

    @Idempotent(expire="PT2S") //2秒内防重复提交
    @Operation(summary = "是否推送信息表删除",description = "是否推送信息表删除")
    @PostMapping(value = "/eduPushparents0006", produces = "application/json;charset=UTF-8")
    public AppResponse del(@RequestBody @Validated EduPushparentsKeyVO vo) {
        eduPushparentsIntegration.del(vo);
        return AppResponse.successMsg("删除成功！");
    }
    @Operation(summary = "是否推送信息表查询当前第几轮报名",description = "是否推送信息表查询当前第几轮报名")
    @PostMapping(value = "/eduPushparents0007", produces = "application/json;charset=UTF-8")
    public AppResponse<EduPushparentsQueryVO> getErollNum(@RequestBody @Validated EduPushparentsQueryVO vo) {
        return AppResponse.successData(eduPushparentsIntegration.getErollNum(vo));
    }
}
